Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] use AddEventListener check instead of OnMessage check #989

Merged
merged 2 commits into from
Mar 22, 2025

Conversation

vegetablechicken233
Copy link
Contributor

Use "len(es.onEvent) == 0 " check instead of "if _, found := es.onEvent[defaultEventName]" check.

Sometimes the implementation of the sse server is not standard, and there is no event with the type of message.
In my opinion, users should be able to use it as long as they have added any eventListener.

Separated from PR #985

Copy link
Member

@jeevatkm jeevatkm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vegetablechicken233 Thanks for the PR.

@jeevatkm
Copy link
Member

@vegetablechicken233, there is a test case failure, please fix.
https://github.com/go-resty/resty/pull/989/checks

Copy link
Member

@jeevatkm jeevatkm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the test case.

Copy link

codecov bot commented Mar 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.81%. Comparing base (e158f04) to head (87dff8f).
Report is 2 commits behind head on v3.

Additional details and impacted files
@@           Coverage Diff           @@
##               v3     #989   +/-   ##
=======================================
  Coverage   99.81%   99.81%           
=======================================
  Files          18       18           
  Lines        3882     3885    +3     
=======================================
+ Hits         3875     3878    +3     
  Misses          5        5           
  Partials        2        2           
Flag Coverage Δ
unittests 99.81% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jeevatkm jeevatkm merged commit 981bb3f into go-resty:v3 Mar 22, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants